{extend name="common/common"}
{block name="content"}
        <div class="tpl-content-page-title">
                    添加类型
                </div>
        
                <ol class="am-breadcrumb">
                    <li><a href="#" class="am-icon-home">首页</a></li>
                    <li><a href="#">分类</a></li>
                    <li class="am-active">内容</li>
                </ol>
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                    <div class="caption font-green bold">
                        <span class="am-icon-code"></span> 添加子类模板
                    </div>
                    <div class="tpl-portlet-input tpl-fz-ml">
                        <div class="portlet-input input-small input-inline">
                            <div class="input-icon right">
                                <i class="am-icon-search"></i>
                                <input type="text" class="form-control form-control-solid" placeholder="搜索..."> </div>
                        </div>
                    </div>


                </div>
                <div class="tpl-block ">
                    <div class="am-g tpl-amazeui-form">
                        <div class="am-u-sm-12 am-u-md-9">
                            <form class="am-form am-form-horizontal" action="{:url('spec/up_revspec')}" method="POST">
                                <input name="old_mould" type="hidden" value="{$data[0]['mould']}">
                                <div class="info-list">
                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-3 am-form-label">提示 / Cue :</label>
                                        <div class="am-u-sm-9">
                                            <h3 class="am-fl type_font">修改暂不支持添加子类,后期会更新,敬请期待</h3>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-3 am-form-label">类型 / Type :</label>
                                        <div class="am-u-sm-9">
                                            <select data-am-selected name="type_id">
                                                <option>- -请选择类型- -</option>
                                            {foreach name="type" id="v"}
                                                {if condition="$v['id']==$data[0]['type_id']"}
                                                <option value="{$v['id']}" selected>{$v['type']}</option>
                                                {else /}
                                                <option value="{$v['id']}">{$v['type']}</option>
                                                {/if}
                                            {/foreach}
                                            </select>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-3 am-form-label">模板名称 / Mould :</label>
                                        <div class="am-u-sm-9">
                                            <input type="text" id="user-name" name="mould" value="{$data[0]['mould']}" placeholder="模板名字避免重名,如有不便请见谅">
                                        </div>
                                    </div>
                                    {foreach name="data" key="k" id='v'}
                                    <div class="am-form-group">
                                        <label for="user-weibo" class="am-u-sm-3 am-form-label">
                                                规格 / Spec :
                                        </label>
                                        <div class="am-u-sm-6 am-input-group">
                                            <span class="am-input-group-label">规格1</span>
                                            <input type="text" name="sub[]" class="am-form-field tpl-form-no-bg" value="{$v['sub']}" placeholder="此框为空,以下属性不保存">
                                        </div>
                                        <div class="am-u-sm-3 am-input-group">
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label for="user-weibo" class="am-u-sm-3 am-form-label">
                                                规格属性:
                                        </label>
                                        {for start="0" end="3"}
                                        <div class="am-u-sm-3 am-input-group">
                                            <span class="am-input-group-label">{$k+1}.{$i+1}</span>
                                            <input type="text" name="spec[{$k}][]" value="{if condition='!empty($v["spec"][$i])'}{$v['spec'][$i]}{else /}''{/if}" class="am-form-field tpl-form-no-bg">
                                        </div>
                                        {/for}
                                    </div>
                                    <div class="am-form-group">
                                        <label for="user-weibo" class="am-u-sm-3 am-form-label">
                                        </label>
                                        {for start="3" end="6"}
                                        <div class="am-u-sm-3 am-input-group">
                                            <span class="am-input-group-label">{$k+1}.{$i+1}</span>
                                            <input type="text" name="spec[{$k}][]" value="{if condition='!empty($v["spec"][$i])'}{$v['spec'][$i]}{else /}{/if}" class="am-form-field tpl-form-no-bg">
                                        </div>
                                        {/for}
                                    </div>
                                    {/foreach}
                                </div>
                                <div class="am-form-group">
                                    <div class="am-u-sm-9 am-u-sm-push-3">
                                        <button type="submit" class="am-btn am-btn-primary">保存提交</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
{/block}
{block name="js"}
<script src="__ADMIN__/assets/js/spec.js"></script>
{/block}